<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var i = 1;
        var sum = 0;
        do {
            sum += i;
            i++;
        } while (i <= 100);
        document.write(sum + "<br>");
        var a = 1;
        var sum = 0;
        do {
            if (a % 2 !== 0) {
                sum += a;
            }
            a++;
        } while (a <= 100);
        document.write(sum + "<br>");
        //for循环
        var nn = 0;
        for (var b = 1; b <= 100; b++) {
            nn += b;
        }
        document.write(nn + "<br>");
        var mm = 0;
        for (var d = 1; d <= 100; d++) {
            if (d % 2 === 0) {
                mm += d;
            }
        }
        for (var o = 0; o < 5; o++) {
            for (var u = 0; u < 5 - o - 1; u++) {
                document.write("&nbsp;&nbsp;");
            }
            for (var p = 0; p <= o; p++) {
                document.write("8");
            }
            document.write("<br>");
        }
    </script>
</body>

</html>